﻿/*
This file is under Microsoft Public License (MS-PL)
Copyright Yohann MARTEL.  All rights reserved.
Codeplex: http://amf.codeplex.com
AMF Website: http://www.ymartel.com/aspnet-mobile-framework/
*/
using System;
using System.Web.UI;

namespace Mobile.WebControls.Field
{
    internal class TextArea : ThemedControl
    {
        #region Properties
        public string FieldName { get; set; }

        public string Value { get; set; }

        #endregion

        #region Render Methods
        protected override void AddAttributesToRender(HtmlTextWriter writer)
        {
            base.AddAttributesToRender(writer);
            if (!String.IsNullOrEmpty(FieldName))
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Name, FieldName);
            }
            if (!String.IsNullOrEmpty(Value))
            {
                writer.AddAttribute(HtmlTextWriterAttribute.Value, Value);
            }
        }

        public override void RenderBeginTag(HtmlTextWriter writer)
        {
            AddAttributesToRender(writer);
            writer.RenderBeginTag(HtmlTextWriterTag.Textarea);
        }

        public override void RenderEndTag(HtmlTextWriter writer)
        {
            writer.RenderEndTag();
        }
        #endregion
    }
}
